package dl.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.client.RestTemplate;

@Controller
public class Hello {

    @Autowired
    RestTemplate restTemplate;

    @RequestMapping("hello")
    @ResponseBody

    public ResponseEntity<String> hello(){
        String result = restTemplate.getForObject("http://152.136.26.199:8000/project/all/",String.class);
        System.out.println(result);
        return ResponseEntity.status(401).body(result);
    }
}
